package com.haihui.platform.dao.dust;

import com.haihui.platform.entity.*;
import org.apache.ibatis.annotations.Param;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

/**
 * Created by HaiHui on 2017/10/13.
 */
@MapperScan
public interface DustDao {
    /**
     * 查询公墓
     * @param model
     * @param pagingBean
     * @return
     */
    List<DustBaseModel> list(@Param("model") DustBaseModel model,@Param("pagingBean") PagingBean pagingBean);

    /**
     * 公墓数量
     * @param model
     * @return
     */
    int getCount(DustBaseModel model);

    /**
     * 添加公墓
     * @param model
     * @return
     */
    int add(DustBaseModel model);

    /**
     * 更新公墓
     * @param model
     * @return
     */
    int update(DustBaseModel model);

    /**
     * 详情公墓
     * @param model
     * @return
     */
    DustBaseModel detail(DustBaseModel model);

    /**
     * 区查询
     * @param region
     * @return
     */
    List<Region> selectRegions(Region region);

    /**
     * 添加区
     * @param region
     * @return
     */
    int addRegion(Region region);
    /**
     * 修改区
     */
    int updateRegion(Region region);

    /**
     * 删除区
     * @param region
     * @return
     */
    int deleteRegion(Region region);

    /**
     * 行查询
     * @param rowModel
     * @return
     */
    List<RowModel> selectRows(RowModel rowModel);

    /**
     * 添加行
     * @param rowModel
     * @return
     */
    int addRow(RowModel rowModel);

    /**
     * 更新行
     * @param rowModel
     * @return
     */
    int updateRow(RowModel rowModel);

    /**
     * 删除行
     * @param rowModel
     * @return
     */
    int deleteRow(RowModel rowModel);

    /**
     * 查询墓穴
     * @param graveModel
     * @return
     */
    List<GraveModel> selectGraves(GraveModel graveModel);

    /**
     * 添加墓穴
     * @param graveModel
     * @return
     */
    int addGrave(GraveModel graveModel);

    /**
     * 更新墓穴
     * @param graveModel
     * @return
     */
    int updateGrave(GraveModel graveModel);

    /**
     * 删除墓穴
     * @param graveModel
     * @return
     */
    int deleteGrave(GraveModel graveModel);

    /**
     * 添加墓穴时更新公墓用
     * @param model
     * @return
     */
    int updateDustByGrave(DustBaseModel model);
    /**
     * 删除墓穴时更新公墓用
     */
    int deleteDustByGrave(DustBaseModel model);
    /**
     * 分配墓穴后更新公墓用
     */
    int updateByFirstGrave(DustBaseModel model);
    /**
     * 合葬后更新公墓用
     */
    int updateBySecondGrave(DustBaseModel model);


}
